// 暴力穷举法
package work4;

public class Quetion3_Brute {
    public static void main(String[] args) {
        int cnt = 0;
        for (int i = 1; i <= 4; i++) {
            for (int j = 1; j <= 4; j++) {
                for (int k = 1; k <= 4; k++) {
                    if (!(i == j || j == k || i == k)) {
                        System.out.print(i * 100 + j * 10 + k + " ");
                        cnt++;
                        if (cnt % 10 == 0) {
                            System.out.println();
                        }
                    }
                }
            }
        }
        System.out.println();
        System.out.printf("共%d个数\n", cnt);
    }
}